package com.igeek.d0611;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author: zhiyu
 * @Date:18:50
 * @DESC:
 */
public class DateUtils implements Runnable{
    public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    public static synchronized Date parseDate(String string){
        Date date = new Date();
        try {
            date = sdf.parse(string);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
        return date;
    }

    public  static void main(String[] args) {
        DateUtils dateUtils = new DateUtils();
        for (int i = 1; i <= 50; i++) {
            Thread thread = new Thread(dateUtils,"线程"+i);
            thread.start();
        }
    }

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+":"+parseDate("2024/06/11 17:02:10"));
    }
}
